#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:3.py
# author:张世航
# datetime:2024/10/31 17:06
# software: PyCharm
"""
this is function  description 
"""
# import module your need


# 练习: 通过函数来实现斐波那契数列输出

def fibonacci(n):
    a, b = 0, 1
    fib_sequence = []
    for _ in range(n):
        fib_sequence.append(a)
        a, b = b, a + b
    return fib_sequence

# 输入要生成的斐波那契数列的长度
n = int(input("请输入斐波那契数列的长度："))
print(f"斐波那契数列前 {n} 项为：{fibonacci(n)}")